<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/views1/DTD/views1-transitional.dtd">
<f:view xmlns="http://www.w3.org/1999/xhtml"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:c="http://java.sun.com/jsp/jstl/core"
	xmlns:p="http://primefaces.prime.com.tr/ui">
	<ui:composition template="/views/layout/main.xhtml">
		<ui:define name="conteudo">
			<h:form id="formPrincipal">
				<div class="grid_18 div_48">
					<p:commandButton id="btn_Buscar" type="button" ajax="false" title="Buscar" onclick="promptBuscaOfertaDisciplina.show();" styleClass="search-notes" />
					<p:commandButton id="btn_Imprimir" ajax="false" action="#{relatorioBean.imprimir}" styleClass="printer" title="Imprimir" />
					<p:commandButton id="btn_Home" ajax="false" action="#{relatorioBean.goHome}" title="Home" styleClass="home"/>
				</div>

				<div class="grid_18 titulo">Relatórios</div>

				<div class="grid_18">
					<p:messages id="mensages" showSummary="false" showDetail="true"/>
				</div>

				<div class="grid_4 div-label">Oferta</div>
				<div class="grid_14 div-campo">
					<p:inputText id="oferta_identificador" disabled="true" styleClass="width_13" value=""></p:inputText>
				</div>
				
				<div class="grid_4 div-label">Prova Selecionada:</div>
				<div class="grid_14 div-campo">
					<p:inputText disabled="true" styleClass="width_9" value="Prova selecionada!" />
				</div>
				
				<div class="clear"></div>
				<div class="grid_18">
					<br/>
					<p:dataTable id="dataTableProvas" 
						selection="#{relatorioBean.provaInstance}" 
						value="#{relatorioBean.provaList}" 
						selectionMode="single" var="p"
						emptyMessage="Nenhum registro encontrado!">
					<p:column headerText="Código" sortBy="#{p.codigo}">  
			            <h:outputText value="#{p.codigo}" />  
			        </p:column> 
					<p:column headerText="Data Início" sortBy="#{p.dataHoraInicio}">  
			            <h:outputText value="#{p.dataHoraInicio}">
			            	<f:convertDateTime pattern="dd/MM/yyyy HH:mm:ss"></f:convertDateTime>
			            </h:outputText>  
			        </p:column> 
			        <p:column headerText="Data Início" sortBy="#{p.dataHoraFim}">  
			            <h:outputText value="#{p.dataHoraFim}">
			            	<f:convertDateTime pattern="dd/MM/yyyy HH:mm:sss"></f:convertDateTime>
			            </h:outputText>  
			        </p:column>
					</p:dataTable>
					<br/>
				</div>
				
				<div class="clear"></div>
				
				<div class="grid_18">
					<p:tabView rendered="#{relatorioBean.ofertaInstance.id > 0 and relatorioBean.provaInstance.id > 0}">
						<p:tab title="Relatório" id="relAlunoProva">
							<ui:include src="/views/relatorios/_relatorioAlunoProva.xhtml" />
						</p:tab>
						<p:tab title="Questões" id="relQuestao">
							<ui:include src="/views/relatorios/_relatorioQuestoes.xhtml" />
						</p:tab>
						<p:tab title="Assuntos" id="relAssunto">
							<ui:include src="/views/relatorios/_relatorioAssunto.xhtml" />
						</p:tab>
					</p:tabView>
				</div>
			</h:form>

			<!-- INCLUSAO DE OUTROS XHTMLs -->
			<ui:include src="/views/relatorios/_promptBuscaOfertaDisciplina.xhtml" />
		</ui:define>
	</ui:composition>
</f:view>